package com.SDU.policedispatch.controller.department_list;

import com.SDU.policedispatch.entity.Person;
import com.SDU.policedispatch.service.department.DepartmentListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/members")
public class DepartmentListController {
    @Autowired
    private DepartmentListService departmentListService;

    @GetMapping("/{name}")
    public List<Person> getAllAccounts(@PathVariable String name) {
        return departmentListService.GetMembers(name);
    }
}
